﻿#region Using's

using System;

#endregion

namespace MyUtils
{
	public class AsyncResults
	{
		public int CurrentStageIterations { get; set; }
		public int CurrentStageProgress { get; set; }
		public bool IsCancelRequested { get; set; }
		public int OverallIterations { get; set; }
		public int OverallProgress { get; set; }
		public int Stage { get; set; }
		public string StageName { get; set; }
		public int StagesNumber { get; set; }

		public event EventHandler StageChanged;
		public event EventHandler ProgressChanged;

		public void SetStage(int stageN, string stageName)
		{
			Stage = stageN;
			StageName = stageName;
			CurrentStageProgress++;
			if (StageChanged != null)
			{
				StageChanged(null, EventArgs.Empty);
			}
			if (ProgressChanged != null)
			{
				ProgressChanged(null, EventArgs.Empty);
			}
		}
	}
}